<style>
	.datatable {
                width:90%;
		text-align: left;
		font-size: 12px;
		font-family: verdana;
		background: #c0c0c0; margin:2px;
	}
        
	.datatable tfoot tr {
		background: #c0c0c0;
	}

	.datatable tbody tr {
		background: #f0f0f0;
                height: 30px;
	}
        
        .dataTable span{
            margin-left: 20px;
            font-size: 14px;
            vertical-align: middle;
        }
	.datatable td, th {
		border: 1px solid white;
                height:28px;
	}
	.datatable td {background-color:white;}
	
	.datatable .hover td {background-color:#99CCFF;}
	
	.datatable .select td {background-color:#EEEE99;}

        #buydetail{
            font-size: 14px;
        }
        #buydetail .bf{
            text-align: center;
            background-color: #CCCCCC;
            width: 6%;
        }
        #buydetail .cf{
            font-size: 14px;
            width: 12%;
        }
        #buydetail .hf{
            text-align: center;
            background-color: #396;
        }
        #buydetail .gf{
            font-size: 16px;
            color: red;
            font-weight: 900;
            width: 12%;
        }
        #buydetail #submit,#buydetail #rereturn{
            width:120px;height: 30px;background:url(/data/tabright10.gif) no-repeat 0% 0px;;color: #fff;font-size: 16px;
        }
        #buydetail #submit:hover,#buydetail #rereturn:hover{
            background-position:0% -42px;
        }
</style>
<?php 
if($this->ma == 1){
    echo '<script language="javascript" type="text/javascript">alert("订单商家发货成功！");location.href = "/admini/managebuyshop/index/"; </script>';
}else if($this->ma == 2){
    echo '<script language="javascript" type="text/javascript">alert("订单的发货只接受已采购的订单！");location.href = "/admini/managebuyshop/index/"; </script>';
}else if($this->ma == 4){
    echo '<script language="javascript" type="text/javascript">alert("发货的物流公司和物流号不能为空！");</script>';
}
?>
<div style="padding:2px; margin:2px;" class="dataTable">
    <table cellspacing="1" width="100%" class="datatable" id="waybill-table" >
	<thead>
		<tr >
                    <th class="w0">宝贝信息</th>
                    <th class="w1">备注</th>
                    <th class="w0">单价</th>
                    <th class="w1">数量</th>
                    <th class="w0">实付款</th>
		</tr>
	</thead>
	<tbody>
                <?php 
                    $shopdetail = $this->result->shipdetail;
                    foreach ($shopdetail as $key => $val) { 
                        $productd = $val->byproductd;
                ?>
                    <tr>
                        <td valign="middle" class="w1" >
                            <div style="float:left;">
                                <a href="<?php echo $productd->remoteImage;?>" target="_blank"><img src="<?php echo $productd->remoteImage;?>" width="50px" height="50px" style="vertical-align:middle;"/></a>
                            </div>
                            <div style="float:left;color:#00f;">
                                &nbsp;&nbsp;<a href="<?php echo $productd->url;?>" target="_blank" ><?php echo iconv_strlen($val->productName)>=50?mb_substr($val->productName,0,50, 'utf-8').'...':$val->productName;?></a>
                            </div><br>
                            <div style="float:left;color:#666;">&nbsp;&nbsp;<?php echo iconv_strlen($productd->PropertyAlias)>=50?mb_substr($productd->PropertyAlias,0,50, 'utf-8').'...':$productd->PropertyAlias;?></div>
                        </td>
                        <td class="w0"><?php echo $val->comment;?></td>
                        <td class="w1" align="center"><?php echo $val->price;?></td>
                        <td class="w0" align="center"><?php echo $val->quantity;?></td>
                        <?php if($key == 0){?>
                            <td class="w1" <?php echo count($shopdetail)>1?'rowspan='.count($shopdetail):'&nbsp';?> align="center">￥<?php echo $this->result->sum;?><br>(含运费：<?php echo 10;?>元)</td>
                        <?php }?>
                    </tr>
                <?php  }?>
                <tr>
                    <td colspan="7" style="padding:0px;">
                        <form action=""  method="post" >
                        <table id="buydetail">
                            <tr><td class="bf">状态：</td><td colspan="6"  class="gf">&nbsp;&nbsp;<?php echo $this->result->StatusText;?></td></tr>
                            <tr>
                                <td class="bf">用户信息：</td><td  class="cf">&nbsp;&nbsp;<?php echo  $this->result->byuserdetail->nikename."(".$this->result->byuserdetail->storeno.")";?></td>
                                <td class="bf">订单号：</td><td  class="cf">&nbsp;&nbsp;<?php echo $this->result->orderid;?></td>
                                <td class="bf">下单时间：</td><td  class="cf">&nbsp;&nbsp;<?php echo $this->result->dateCreated;?></td><td width="30%"></td>
                            </tr>
                            <tr>
                                <td class="bf">物品来源：</td><td  class="cf">&nbsp;&nbsp;<?php echo  $this->result->parentId;?></td>
                                <td class="bf">采购订单号：</td><td  class="cf">&nbsp;&nbsp;<?php echo $this->result->procureNo;?></td>
                                <td class="bf">采购时间：</td><td  class="cf">&nbsp;&nbsp;<?php echo $this->result->dateProcure;?></td><td width="30%"></td>
                            </tr>
                            <tr>
                                <td class="hf">物流公司：</td><td  class="cf">&nbsp;&nbsp;<input id="logistics" name="logistics" type="text" style="height:24px;font-size: 16px;" /></td>
                                <td class="hf">物流单号：</td><td  class="cf" colspan="4">&nbsp;&nbsp;<input id="logisticsNo" name="logisticsNo" type="text" style="height:24px;font-size: 16px;" /></td>
                            </tr>
                            <tr>
                                <td class="cf" colspan="7"><input type="submit" name="submit" id="submit" value="确认发货" style="width:120px;height: 30px;background-color: #1668A4;" />
                                    <input type="button" name="rereturn" id="rereturn" value="返回列表"  />
                                    <input type="hidden" name="id" id="id" value="<?php echo $this->result->id;?>" />
                                    <input type="hidden" name="motion" id="motion" value="buyprocure" /></td></td>
                            </tr>
                        </table>
                        </form>
                    </td>
                </tr>
	</tbody>
    </table>
</div>
<script type="text/javascript">
    $('#rereturn').click(function(){
        location.href="/admini/managebuyshop/index/";
    });
</script>